home *** CD-ROM | disk | FTP | other *** search
/ The Arsenal Files 8 / The Arsenal Files Collection #8 (Arsenal Computer) (1996).ISO / prg_casm / snpd9611.zip / WHICHARC.DOC < prev    next >
Text File  |  1996-11-24  |  4KB  |  101 lines

  1. +++Date last modified: 16-Nov-1996
  2.  
  3. ================ whicharc.doc =====================================
  4.  
  5.    --------------------------------------------------------------------
  6.    Modules:    ARCHIVE.CPP, WHICHARC.CPP
  7.    Subject:    tries to determine the archiver used to compress files
  8.    Author:     Heinz Ozwirk
  9.                free for all participants of the C_ECHO
  10.    Started:    28.09.1991   13:35:57
  11.    Modified:   13.10.1991   14:15:57
  12.    Modified:    5 January, 1992 11:50am by David Gersic
  13.                    Added return codes for self  extracting archive files.
  14.    Modified:   16 January, 1992, 4:15pm by David Gersic
  15.                    Added Pak and ARC ver. 6 with information from Richard
  16.                    Vanhouten @1:272/38. I'm not sure that this code works
  17.                    perfectly for those formats, as his message seems to
  18.                    indicate that the entire archive has to be scanned for
  19.                    headers to check before the type can be perfectly
  20.                    determined. It seems to work for test archives produced
  21.                    here, but may not work for all archives.
  22.    Modified:   02 September, 1994 by Jari Laaksonen (2:221/360.20)
  23.                    - partially rewritten, archive types are now C++ classes
  24.                    - added checking of some newer archivers (I'm not sure
  25.                      about the offsets for some SFX archives, but it is
  26.                      now easy to add new archive types).
  27.    --------------------------------------------------------------------
  28.    Prototype:  int WhichArc (char *pName)
  29.       pName    address of full path name of file to examine
  30.       Result   -1:      file not found
  31.                UNKNOWN: unknown packer
  32.                ARC:     ARC or PKARC
  33.                ARC6:    ARC ver. 6 or higher
  34.                PAK:     Pak
  35.                HPK:     Hpack
  36.                ZOO:     Zoo
  37.                ARJ:     ARJ
  38.                RAR:     RAR
  39.                UC2:     UC2
  40.                SQZ:     SQZ
  41.                LHA:     LHA
  42.                LHARC:   LHARC
  43.                ZIP1:    PKZIP 1.1x
  44.                ZIP2:    PKZIP 2.xx
  45.                SFXARC:  Self Extracting PKARC
  46.                SFXARC6: Self Extracting ARC ver. 6 or higher
  47.                SFXPAK:  Self Extracting Pak
  48.                SFXARJ:  Self Extracting ARJ
  49.                SFXLHARC:Self Extracting LHARC
  50.                SFXLHA:  Self Extracting LHA
  51.                SFXZIP1: Self Extracting ZIP 1.1x
  52.                SFXZIP2: Self Extracting ZIP 2.xx
  53.                EXE:     MS DOS executable of unknown type
  54.  
  55.    LHARC/LHA
  56.       No archive header. WhichArc examines the checksum of the first
  57.       file header. If the checksum is valid and if the string -lh?-
  58.       is found, LHA or LHARC is assumed.
  59.       SFX offsets: LHARC         0x653
  60.                    LHA v.???     0x799
  61.                    LHA v.2.10    0x665
  62.                    LHA v.2.12->  0x664
  63.  
  64.    ARJ
  65.       If a file starts with 0x60, 0xEA, ARJ is assumed.
  66.       SFX offsets: ->ARJ 2.22    0x39BA
  67.                      ARJ 2.41    0x4F4
  68.  
  69.    ZIP1
  70.       If the file begins with "PK\x03\x04\x0A", PKZIP 1.1x is assumed.
  71.       SFX offsets: PkZip 1.1x    0x31F0
  72.  
  73.    ZIP2
  74.       If the file begins with "PK\x03\x04\x14", PKZIP 2.xx is assumed.
  75.       SFX offsets: PkZip 2.04c   0x3CCB
  76.                    PkZip 2.04g   0x3D9A
  77.                    PkZip SFXJr   0xBBA
  78.  
  79.    ZOO
  80.       Zoo'ed archives always start with "ZOO x.xx Archive". WhichArc
  81.       only looks for "ZOO".
  82.  
  83.    ARC
  84.       No header. Files starting with 0x1A are assumed to be ARCed.
  85.       SFX offsets:               0x261E
  86.  
  87.    ARC6
  88.       Similar to ARC, but if the second byte of the header is 0x14 or
  89.       higher, it was created by Arc version 6 or higher.
  90.       SFX offsets:               0x261E
  91.  
  92.    PAK
  93.       Similar to ARC files, but if the second byte of the header is 0x0a or
  94.       0x0b, it was created by Pak.
  95.       SFX offsets:               0x1AD3
  96.  
  97.    SFX*
  98.       All of the SFX files start with a small decompressor. Seek past
  99.       the decompressor and repeat the above checks.
  100.    --------------------------------------------------------------------
  101.